<div class="form">
    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'category-form',
        'enableClientValidation' => true,
            ));
    ?>

    <table class="form" style="width: 100%">
        <tr>
            <td style="width: 400px">
                <table>
                    <tr>
                        <td class="label required"><?php echo $form->labelEx($model, 'name'); ?></td>
                        <td class="input" width="250px">
                            <?php echo $form->textField($model, 'name', array('style' => 'width:180px','placeholder' => t('PLH_NAME', 'category'))); ?>
                            <?php echo $form->error($model, 'name'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="label"><?php echo $form->label($model, 'alias'); ?></td>
                        <td class="input " >
                            <?php echo $form->textField($model, 'alias', array('style' => 'width:180px','placeholder' => t('PLH_ALIAS', 'category'))); ?>
                            <?php echo $form->error($model, 'alias'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="label"><?php echo $form->label($model, 'parent_id'); ?></td>
                        <td class="input">
                            <?php echo $form->dropDownList($model, 'parent_id', array('0' => t('MSG_NO_PARENT', 'messages')) + Category::model()->getListDataForParentDropDownList($model->id, $this->extension), array('style' => 'width:191px')); ?>
                            <?php echo $form->error($model, 'parent_id'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="label"><?php echo $form->label($model, 'status'); ?></td>
                        <td class="input">
                            <?php echo $form->dropDownList($model, 'status', $model->getStatus(), array('options' => array(LGConstant::PUBLISH_STATUS => array('selected' => true)), 'style' => 'width:120px')); ?>
                            <?php echo $form->error($model, 'status'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="label"><?php echo $form->label($model, 'language'); ?></td>
                        <td class="input">
                            <?php echo $form->dropDownList($model, 'language', array('*' => t('MSG_ALL_LANGUAGE', 'messages')) + CHtml::listData(Language::model()->findAll(), 'code', 'value'), array('style' => 'width:120px')); ?>
                            <?php echo $form->error($model, 'language'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="label" style="vertical-align: text-top;"><?php echo $form->labelEx($model, 'description'); ?></td>
                        <td class="input" >
                            <?php echo $form->textArea($model, 'description', array('style' => 'width:180px;height:80px')); ?>
                            <?php echo $form->error($model, 'description'); ?>
                        </td>

                    </tr>
                </table>
            </td>
            <td style="padding-left: 10px; vertical-align: top;">
                <fieldset>
                    <legend><?php echo t('LBL_METADATA_OPTION', 'category') ?></legend>
                    <table>

                        <tr>
                            <td class="label" style="vertical-align: text-top;"><?php echo $form->labelEx($model, 'meta_description'); ?></td>
                            <td class="input"><?php echo $form->textArea($model, 'meta_description', array('style' => 'width:180px;height:80px', 'placeholder' => t('PLH_METAL_DESCRIPTION', 'category'))); ?>
			     <?php echo $form->error($model, 'meta_description'); ?>
			    </td>
                        </tr>
                        <tr>
                            <td class="label" style="vertical-align: text-top;"><?php echo $form->labelEx($model, 'meta_keyword'); ?></td>
                            <td class="input" >
				<?php echo $form->textArea($model, 'meta_keyword', array('style' => 'vertical-align: text-top; width:180px;height:80px', 'placeholder' => t('PLH_METAL_KEYWORDS', 'category'))); ?>
				<?php echo $form->error($model, 'meta_keyword'); ?>
			    </td>
                        </tr>
                        <tr>
                            <td class="label required"><?php echo $form->labelEx($model, 'robots'); ?></td>
                            <td class="input">
                                <?php echo $form->dropDownList($model, 'robots', Category::model()->getRobots(), array('empty' => t('MSG_FIRST_ROBOTS', 'messages'))); ?>
                                <?php echo $form->error($model, 'robots'); ?>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="cbutton">
                <?php echo Html::buttonConfirm(t('BTN_SAVE'), 'statusConfirmed'); ?>
                <?php echo Html::buttonConfirm(t('BTN_CANCEL'), 'statusCanceled', 'cancel'); ?>
            </td>
        </tr>
        <tr>
            <td class="input" width="250px">
                <?php echo $form->hiddenField($model, 'oldParentId', array('style' => 'width:180px')); ?>
		<?php if (!$model->isNewRecord) {
	
		    echo $form->hiddenField($model, 'originalStatus', array('style' => 'width:180px')); 
		}?>
	    </td>
        </tr>       
    </table>  
    <?php $this->endWidget(); ?>
    <script type="text/javascript">
        LGCMS.addTooltip();
        $(document).ready(function() {
            $('#Category_oldParentId').val($('#Category_parent_id').val());
        });
    </script>
</div>
